import React, { Component } from 'react';
import {Provider} from 'react-redux';
import { BrowserRouter, Route } from 'react-router-dom';
import Header from './common/header'; 
import Home from './pages/home'
// import Detail from './pages/detail'
import Detail from './pages/detail/loadable'
import store from  './store';
import Login from './pages/login'
import Write from './pages/write';

class App extends Component {
   render() {
     return (
        <div>
           <Provider store={store}>  
               <BrowserRouter>
                  <div>
                     <Header /> 
                     <Route exact path="/" component={Home}/>
                     <Route exact path="/login" component={Login}/> 
                     <Route exact path="/detail/:id" component={Detail}/> 
                     <Route exact path="/write" component={Write}/> 
                  </div>  
               </BrowserRouter>   
           </Provider> 
        </div>
     )
   }
} 


export default App